<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="header::header" />
<body>
	<div id="dgtoolbar" class="datagrid-toolbar">
		<a id="newbtn" href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" title="新增">新增</a> <a id="deletebtn" href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" title="批量删除">删除</a> <a id="reloadbtn" href="#" class="easyui-linkbutton" iconCls="icon-reload" plain="true">刷新</a> <a id="backbtn" onclick="goBack()" href="#" class="easyui-linkbutton" iconCls="icon-back"
			plain="true"
		>返回</a>
	</div>
	<!-- 表格 -->
	<table id="dg" class="easyui-datagrid" data-options="url:'pageQuery',idField:'iid',rownumbers:true,singleSelect:false,method:'post',toolbar:'#dgtoolbar',pagination:true,pageSize:20,pageList:[20,30,50],fit:true,onLoadSuccess:onDGLoadSuccess">
		
		<thead>
			<tr>
				<th data-options="field:'iid'" checkbox="true"></th>
				<th data-options="field:'cname'" width="100" align="center">名称</th>
				<th data-options="field:'ckey'" width="100" align="center">关键字</th>
				<th data-options="field:'cvalue'" width="100" align="center">值</th>
				<th data-options="field:'isort'" width="80" align="center">排序</th>
				<th data-options="field:'ccreator'" width="80" align="center">添加人</th>
				<th data-options="field:'dcreator'" width="150" align="center">添加时间</th>
				<th data-options="field:'cmodify'" width="80" align="center">修改人</th>
				<th data-options="field:'dmodify'" width="150" align="center">修改时间</th>
				<th data-options="field:'ccomment'" width="200" align="center">备注</th>
				<th data-options="field:'opt',formatter:onItemOptEdit" width="40" align="center">修改</th>
				<th data-options="field:'opt1',formatter:onItemOptDelete" width="40" align="center">删除</th>
				<th data-options="field:'opt2',formatter:onItemOptShow" width="40" align="center">查看</th>
			</tr>
		</thead>
	</table>
	<!-- 弹出框 -->
	<div id="dlg" class="easyui-dialog" title="操作" style="padding:5px" data-options="buttons: '#dlg-buttons',closed:'true',modal:true">
		<form id="dataform" method="post"  enctype="multipart/form-data">
			<table>
				
				<tr>
					<td>名称:</td>
					<td><input name="iid" id="iid" type="hidden"></input> <input name="cname" class="easyui-textbox" style="width: 200px" data-options="required:true"></input></td>
				</tr>
				<tr>
					<td>关键字:</td>
					<td><input name="ckey" id="ckey"  class="easyui-textbox"  style="width: 200px" data-options="editable:false"></input></td>
				</tr>
				<tr>
					<td>值:</td>
					<td><input name="cvalue" class="easyui-textbox" style="width: 200px" data-options="required:true"></input></td>
				</tr>
				<tr>
					<td>排序:</td>
					<td><input name="isort" class="easyui-numberspinner" style="width: 200px" data-options="min:0,max:100,required:true"></input></td>
				</tr>
				<tr>
					<td>备注:</td>
					<td><input name="ccomment" class="easyui-textbox" style="width: 200px" data-options="required:false"></input></td>
				</tr>
			</table>
		</form>
	</div>
	<!-- 弹出框工具栏 -->
	<div id="dlg-buttons">
		<a id="dlg-savebtn" href="javascript:void(0)" style="width:50" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="dlg-closebtn" href="javascript:void(0)" style="width:50" class="easyui-linkbutton" iconCls="icon-no">关闭</a>
	</div>
</body>
<script type="text/javascript" th:src="@{/common/GridView.js}"></script>
<script type="text/javascript" th:inline="javascript">
		$(document).ready(function(){
			var ckey=/*[[${ckey}]]*/;
 			$("#dg").datagrid({
					queryParams:{
						ckey:ckey
					}
			})

		
		
})
function onNewHandler() {
var ckey=/*[[${ckey}]]*/;
	$("#dlg-savebtn").linkbutton("enable");
	$("#dataform").form("clear");
	$("#ckey").textbox("setValue",ckey)
	$("#dlg").dialog({
		iconCls : "icon-add",
		title : "新增" + indexname
	});
	$("#dlg").dialog("open");
	opttype = "save";
	$("#iid").val(0);
	$("#dlg-savebtn").linkbutton({
		"text" : "保存"
	});
	$("#dlg-savebtn").show();
	try {
		if (subNewHandler && typeof (subNewHandler) == "function") {
			subNewHandler();
		}
	} catch (e) {

	}
}

function goBack(){

window.location.href="../dicclasses/index";
}
</script>
</html>